package com.ruoyi.game.service;

import com.ruoyi.game.core.GameRoomCore;
import com.ruoyi.game.websocket.message.packet.WsPacket;
import org.springframework.web.socket.WebSocketSession;

import java.util.List;

public interface IGameWebSocketListener {
    /**
     * 处理玩家连接成功后的逻辑，返回需要发出的消息列表
     */
    List<WsPacket<?>> onPlayerConnectedAndBuildPackets(Long roomId, Long playerId);
    /** 在新房间绑定前，尝试清除旧房间绑定 */
    void onPlayerBeforeReconnect(Long playerId, Long currentRoomId, Long newRoomId);

    void onPlayerBeforeDisconnect(Long playerId, Long roomId);
}
